package org.jim.core.packets;

import org.jim.core.utils.DynamicEnumUtil;

/**
 * @ProjectName: jim
 * @Package: org.jim.core.packets
 * @ClassName: InstructId
 * @Description: java类作用描述
 * @Author: wmt
 * @CreateDate: 2020/6/18 10:02
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/6/18 10:02
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public enum InstructId {

    TurnOnTheCamera(10101),//打开摄像头
    TurnOnAllCamera(10102),//打开所有人摄像头
    TurnOffTheCamera(10103),//关闭摄像头
    TurnOffAllCamera(10104),//关闭所有人摄像头

    TurnOnTheMicrophone(10201),//打开麦克风
    TurnOnAllMicrophone(10202),//打开所有人麦克风
    TurnOffTheMicrophone(10203),//关闭麦克风
    TurnOffAllMicrophone(10204),//关闭所有人麦克风

    EnterTheRoom(10301),//进入房间
    LeaveTheRoom(10302),//离开房间

    CloseMeeting(10401),//结束会议
    GetKickedOutOfTheMeeting(10402),//被踢出会议

    chageName(10501);//修改与会名称



    public final int getNumber() {
        return value;
    }

    public static InstructId valueOf(int value) {
        return forNumber(value);
    }

    public static InstructId forNumber(int value) {
        for(InstructId instructId : InstructId.values()){
            if(instructId.getNumber() == value){
                return instructId;
            }
        }
        return null;
    }

    public static InstructId addAndGet(String name , int value){
        return DynamicEnumUtil.addEnum(InstructId.class, name,new Class[]{int.class}, new Object[]{value});
    }

    private final int value;

    private InstructId(int value) {
        this.value = value;
    }
}
